From 86daec4c06cba01bbe5c9174166b82f4d4785a24 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Tue, 27 Mar 2007 16:03:30 +0100 Subject: [PATCH] Further shrink the big-lock window. A few more adjustments to when the 'big' lock is taken/dropped. Also, fix a case where the foreign domain setting may not get properly cleared at the end of a hypercall (in case of an early error). Signed-off-by: Jan Beulich Signed-off-by: Keir Fraser --- xen/arch/x86/mm.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index e0590f33a2..aa135c96f4 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2431,13 +2431,13 @@ int do_mmu_update( guest_handle_add_offset(ureqs, 1); } - domain_mmap_cache_destroy(&mapcache); - domain_mmap_cache_destroy(&sh_mapcache); - process_deferred_ops(); UNLOCK_BIGLOCK(d); + domain_mmap_cache_destroy(&mapcache); + domain_mmap_cache_destroy(&sh_mapcache); + out: /* Add incremental work we have done to the @done output parameter. */ if ( unlikely(!guest_handle_is_null(pdone)) ) @@ -2740,6 +2740,10 @@ int do_update_va_mapping(unsigned long va, u64 val64, guest_unmap_l1e(v, pl1e); pl1e = NULL; + process_deferred_ops(); + + UNLOCK_BIGLOCK(d); + switch ( flags & UVMF_FLUSHTYPE_MASK ) { case UVMF_TLB_FLUSH: @@ -2785,10 +2789,6 @@ int do_update_va_mapping(unsigned long va, u64 val64, break; } - process_deferred_ops(); - - UNLOCK_BIGLOCK(d); - return rc; } @@ -2806,6 +2806,9 @@ int do_update_va_mapping_otherdomain(unsigned long va, u64 val64, rc = do_update_va_mapping(va, val64, flags); + BUG_ON(this_cpu(percpu_mm_info).deferred_ops); + process_deferred_ops(); /* only to clear foreigndom */ + return rc; } -- 2.30.2